					<style>
						.ellipsis {white-space: nowrap;overflow: hidden;}
						.ellipsis.multiline {white-space: normal;}
						.meter{ width: 90px;margin-left: -45px;height: 1px;display: inline-block;border:1px solid #cacaca;position:absolute; }
						.meter span{ display: inline-block;height: 1px;position:absolute;left:0px;}
						.meter .low{ background:red; }
						.meter .med{ background:orange; }
						.meter .hi{ background:green; }
					</style>
					<div class="listing_product">
					<script type="text/javascript" src="<?php $this->path('js/checkBox.js');?>"></script>
					<?php if ($view == 0){ ?>
					<table id="list-item">
						<tr>
							<th style="text-align:left;"><input class="niceCheck" type="checkbox" /></th>
							<th class="bg">Item</th>
							<th width="150px">Category</th>
							<th width="150px" class="bg">Unit Price(W/R)</th>
							<th width="135px">Stock</th>
						</tr>
						<?php if (COUNT($list) > 0) { ?>
						<?php foreach ($list as $item) { ?>
						<tr id="<?php echo $item['iid'] ?>">
							<td style="text-align:left;"><input class="niceCheck" type="checkbox" /></td>
							<td class="bg"><?php echo $item['iname'] ?></td>
							<td><?php echo $item['cname'] ?></td>
							<td class="bg"><?php echo $item['price'] ?></td>
							<?php 
								$percent = $item['stock'];
								if($percent > 100)
									$percent = 100;
								if($percent > 70)
									$level = "hi";
								else if($percent > 25)
									$level = "med";
								else
									$level = "low";
							?>
							<td>
								<small style="font-size:11px;margin: 0px;text-align: right;padding-right: 20px;margin-top: -12px;"><span title='quantity'><?php echo $item['quantity']. "</span> [ <span title='reorder level'>" . $item['reorder'] . " </span>]" ?></small>
								<div class="meter">
								<span style="width:<?php echo $percent; ?>% !important"  class="<?php echo $level;?>"></span>
								</div>
							</td>
						</tr>
						<?php } ?>
						<?php } ?>
					</table>
					</div><!-- product_li -->
					
        			<div class="clear"></div>
        			
					<script>
						$('#list-item th:first-child span').click(function(){
							if( $(this).hasClass('niceChecked') )
								$(this).parent().parent().parent().find('td span').addClass('niceChecked');
							else
								$(this).parent().parent().parent().find('td span').removeClass('niceChecked');
						});
					</script>
					<?php } else { ?>
					<?php $this->showPagination( "?module=pos&action=inventory",$page, $total[0], $total[0]>$max_display?$max_display:$total[0]); ?>
					<div class="clearfix"></div>
					<br />
					<?php if (COUNT($list) > 0) { ?>
						<?php foreach ($list as $item) { ?>
					<div class="product_li" id="list-item">
						<div class="grid_3" style="width:170px;height:170px;">
							<?php if ($item['isnew'] < 10 && $item['isnew'] >= 0){?>
							<img class="sale" src="<?php $this->path('img/new.png');?>" alt="New"/>
							<?php } ?>
							<div class="prev">
								<a href="#" style="width:150px;height:150px;">
									<img style="height:inherit;width:inherit;" src="#" alt="" title="" />
								</a>
							</div><!-- .prev -->
						</div><!-- .grid_3 -->
				
						<div class="grid_4" style="width:410px;height:166px;">
							<div class="entry_content">
								<h3 class="title"><a href="#"><?php echo $item['iname'] ?></a> (<?php echo $item['quantity'] ?>)</h3>
								<div class="ellipsis multiline" style="height: 95px;"><?php echo $item['description'] ?></div>
							</div><!-- .entry_content -->
						</div><!-- .grid_4 -->
				
    					<div class="grid_2" style="">
    						<div class="cart">
    							<div class="price" style="margin:-10px;position:absolute;" id="<?php echo $item['iid'] ?>">
    								<div class="price_old">Price:</div>
    								<div class="price_new">P<?php echo $item['unit_price'] ?></div>
    								<div class="price_old">Mark up:</div>
    								<div class="price_new">P<?php echo $item['mark_up'] ?></div>
    								<div class="price_old">Category:</div>
    								<div class="price_new">N/A</div>
    								<div class="price_old">Brand:</div>
    								<div class="price_new" style="margin:0px">N/A</div>
									<div style="position:absolute;top:15px;right:-100px;"><input class="niceCheck" type="checkbox"/></div>
    							</div>
    						</div><!-- .cart -->
    					</div><!-- .grid_2 -->
    				
						<div class="clear"></div>
					</div><!-- .article -->
					
						<?php } ?>
					<?php } ?>
					<?php } ?>
	      
					<?php $this->showPagination( "?module=pos&action=inventory",$page, $total[0], $total[0]>$max_display?$max_display:$total[0], true); ?>
					<script>
						$('.pagination2 ul li a').click(function(e){
							var type = -1;
							var src = $(this).attr('href');
							e.preventDefault();
							
							$('.grid-list a').each(function(){
								if(!$(this).hasClass('grid'))
									type++;
							});
							if(src == '#')
								return false;
							src = src.replace('page','p');
							$.post(src + '&action2=list&ajax=true', {view:view_by, display:max_display, sort_by:sort_by, sort_with:sort_with}, function(data) {
    							set_listing(data);
    						});
						});
					</script>
        			<div class="clear"></div>